﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BookStore.Data;
using BookStore.Bussiness;

namespace BookStore.Controls
{
    public partial class adm_top : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (string.IsNullOrEmpty(Convert.ToString(Session["Administrator"])))
            //{
            //    Response.Redirect("~/admin/Login.aspx");
            //}
            //int i;
            //int iduser = Convert.ToInt32(Session["Administrator"]);
            //adminInfo adm = admin
            //if (ad != null)
            //{
            //    lblname.Text = " " + ad.fullname + ",DATE REGISTER" + ad.registerDate.ToString();
            //}
            if (Session["Administrator"]!=null)
            {
                lblname.Text = Session["Administrator"].ToString();
            }
            
        }

        protected void imgbtnLogout_Click(object sender, ImageClickEventArgs e)
        {
            Session.Abandon();
            Response.Redirect("~/admin/Login.aspx");
        }

        protected void lbtDefault_Click(object sender, EventArgs e)
        {
            LinkButton lbt = (LinkButton)sender;
            Response.Redirect("~/admin/" + lbt.ID.Substring(3) + ".aspx");
        }
    }
}